<template>
    <div>
        <h2>房号添加</h2>
<table class="table">

    <tbody>
       <tr>
        <td>房间名称</td>
        <td>
            <input type="text">
        </td>
       </tr>


        <tr>
            <td>房间类型</td>
        <td>
            <select>
                <option value="" >请选择</option>
                <option :value="item.Id" v-for=" item in lists"  >{{item.TypeName}}</option>
            </select>
        </td>
        </tr>



       <tr>
        <td>房间状态</td>
        <td>
            <select>
                <option value="">请选择</option>
                <option :value="1">空闲</option>
                <option :value="2">已预约</option>
                <option :value="3">已入住</option>
            </select>
        </td>
       </tr>

        <tr>
            <td>门店</td>
        <td>
            <select>
                 <option value="">请选择</option>
                 <option :value="item.Id" v-for=" item in  data.list">{{item.ShopName}}</option>
            </select>
        </td>
        </tr>



        <tr>
            <td></td>
        <td>
           <input type="button" value="添加" class="btn btn-success" @click="ok">
        </td>

        </tr>



    </tbody>
</table>



    </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue';
 import axios from 'axios';
 import { useRouter ,useRoute} from 'vue-router';
 const router=useRouter();
 const  route=useRoute();

onMounted(()=>{
getlists();
getList();

})

let lists:any=ref([]);

let model=reactive({
TypeName:'',
})

let getList=()=>{
axios({
url:'/api/HouseType/HouseTypeList',
method:'get',
params:model,
})
.then((res)=>{
console.log(res);
lists.value=res.data;

})
.catch((ree)=>{
console.log(ree);
})


}

//接受后端的数据
let data=reactive({
list:[],
count:0,
page:0,
})


let ojb =reactive({
shopName:'',
Index:1,
size:100000,
})

//列表
const getlists=()=>{
axios({
url:'/api/Shop/GetShopList',
method:'get',
params:ojb,
})
.then((res)=>{
  console.log(res);
  data.list=res.data.list;
  data.count=res.data.count;
  data.page=res.data.page;
})
.catch((ree)=>{
  console.log(ree);
})

}
 //添加
const ok=()=>{

//1 判断
//2发送数据





}


</script>

<style scoped>

</style>